import {createApp} from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

import store from './store'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.use(router)
app.use(ElementPlus, {
    locale: zhCn
})
app.use(store)

app.mount('#app')

// 计算首屏的加载v时间

// window.onload = function () {
//     // 性能指标 旧的
//     console.log(performance.timing.domComplete - performance.timing.navigationStart)

//     const observer = new PerformanceObserver((list) => {
//         list.getEntries().forEach(entry => {
//             console.log(entry.domComplete)
//         })
//     })

//     // 启动监听，监听的列表会在list显示
//     observer.observer({ entryTypes: ['navigation'] })
// }
